import { createApp } from 'vue'
import './style.css'
import App from './App2.vue'
import escookPlugin from './utils/escookPlugin'

const app = createApp(App)

// 声明全局的自定义指令
app.directive('focus', {
  created(el) {
    // console.log(el.title)
  },
  beforeMount(el) {
    // console.log(el.title)
    // console.log(el.parentNode)
  },
  mounted: (el) => {
    // console.log('触发了全局的自定义指令 focus')
    el.focus()
    // console.log(el.parentNode)
  },
  beforeUpdate(el) {
    console.log(el.title)
  },
  updated(el) {
    console.log(el.title)
  }
})

// 注册插件
app.use(escookPlugin, { globalData: { name: '李四', age: 22 } })

app.mount('#app')
